package LeetCode_力扣;

class Solution_283 {
    public void moveZeroes(int[] nums) {

        int conut = 0;//统计零的个数
        int p1 = 0;
        int p2 = 0;

        while(p2 < nums.length){

            if(nums[p2] == 0){
                conut++;
                p2++;
            }else{
                nums[p1] = nums[p2];
                p1++;
                p2++;
            }

        }

        while(conut > 0){
            nums[p1] = 0;
            p1++;
        }
    }
}